import request from '@/plugins/axios/request';
let baseURL = process.env.VUE_APP_BASE_API + "/backup"

// 获取备份列表
export function getList(data) {
  return request({
    url: `${baseURL}/list`,
    method: `POST`,
    data: data
  })
}

// 备份记录删除
export function deleteList(data) {
  return request({
    url: `${baseURL}/delete`,
    method: `get`,
    params: data
  })
}

// 更新备份
export function updateBackup(data) {
  return request({
    url: `${baseURL}/update`,
    method: `post`,
    data: data
  })
}


// 手动备份
export function handBackup() {
  return request({
    url: `${baseURL}/manual`,
    method: `get`
  })
}

// 数据恢复
export function recoverData(data) {
  return request({
    url: `${baseURL}/recover`,
    method: `get`,
    params: data
  })
}


// 获取备份列表
export function exportBackup(data) {
  return request({
    url: `${baseURL}/exportBackup`,
    method: `get`,
    params: data,
    isLoading:true,
    isShowMessage:true
  })
}

// 获取备份列表
export function exportBackupById
(data) {
  return request({
    url: `${baseURL}/exportBackupById/${data.id}
    `,
    method: `get`,
    // params: data,
    // isDownLoadFile: true
  })
}

export function importBackupFile
(data) {
  return request({
    url: `${baseURL}/importBackupFile`,
    method: `post`,
    data: data,
    isLoading:true,
    isShowMessage:true
  })
}